﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Frost {
    public static class TestFactory {
        public static ITest ConstructTestFromFile(string file) {
            var typeOfTest = GetTypeFromExtension(Path.GetExtension(file));

            var test =  (ITest)typeOfTest.Assembly.CreateInstance(typeOfTest.ToString());
            test.Name = Path.GetFileName(file);

            return test;
        }


        public static Type GetTypeFromExtension(string fileExtension) {
            switch (fileExtension) {
                case ".htm":
                case ".html":
                    return typeof(FitTest);
            
            }

            return null;
        }
    }
}
